import plotly.express as px
import pandas as pd


def trace_point_shows():
    df = pd.read_excel('./data/typhoon.xlsx')
    print(df)
    token = 'pk.eyJ1IjoiemhhZmVpZmFuIiwiYSI6ImNsOHBkYnNlczAwOW8zdHBlZDc2MHc1YTYifQ.jDZzWVWIKx9RqvRkIzi34Q'
    fig = px.scatter_mapbox(df,
         hover_data=['时间'],
         lon = '经度',
         lat = '纬度',
         color = '风速(m/s)',
         hover_name = '名称',
         size_max = 14,
         color_continuous_scale = px.colors.carto.Temps
        )
    fig.update_layout(mapbox = {'accesstoken': token, # 官网注册token
                             'center':{'lon':121.54,'lat':25.00}, # 地图中心
                             'zoom': 8,
                             'style': 'dark', # 显示地图类型
                            },
                   margin = {'l': 1, 'r': 1, 't': 1, 'b': 1}) # 地图边界
    fig.write_html('./data/trace_point_shows-1.html')

trace_point_shows()